import cv2
cap=cv2.VideoCapture(0)
ok=True
result=[]
while ok:
    ok,img=cap.read()
    cv2.imshow('Video',img)
    k=cv2.waitKey(1)
    if k== 27:
        break
cap.release()
cv2.destroyAllWindows()